home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Personal Computer World 2009 February
/
PCWFEB09.iso
/
Software
/
Resources
/
Burning & Media
/
GB-PVR 1.2.13
/
GBPVR10213.msi
/
Cabs.w1.cab
/
Credits.aspx.cs54
< prev
next >
Wrap
Text File
|
2008-03-01
|
12KB
|
336 lines
//===========================================================================
// This file was modified as part of an ASP.NET 2.0 Web project conversion.
// The class name was changed and the class modified to inherit from the abstract base class
// in file 'App_Code\Migrated\Stub_Credits_aspx_cs.cs'.
// During runtime, this allows other classes in your web application to bind and access
// the code-behind page using the abstract base class.
// The associated content page 'Credits.aspx' was also modified to refer to the new class name.
// For more information on this code pattern, please refer to http://go.microsoft.com/fwlink/?LinkId=46995
//===========================================================================
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using GBPVRSchedule;
using gbweb.classes;
using GBPVR.Public;
namespace gbweb
{
/// <summary>
/// Summary description for Credits.
/// </summary>
public partial class Migrated_Credits : Credits
{
private Settings guideParams;
protected string programUniqueIdentifier;
protected void Page_Load(object sender, System.EventArgs e)
{
getTheme();
guideParams = Global.Settings;
if (!IsPostBack)
{
Schedule scheduleHelper = Global.Schedule;
Programme programme = null;
programme = scheduleHelper.GetProgrammeByOID(int.Parse(Request.Params["id"]));
// show programme details
showTitle.Text = programme.getTitle();
programUniqueIdentifier = programme.getUniqueProgrammeIdentifier();
showSubTitle.Text = programme.getSubTitle();
bool ExtendedEWAEnabled = ExtendedEWA.Initialize();
string description = DetailDisplay.getDetailDisplay(programme);
if (ExtendedEWAEnabled)
{
//Open the ExtendedEWA DB
ExtendedEWA.OpenExtendedEWADB();
//Pull all the cast/crew found for the show
ArrayList cast = ExtendedEWA.GetCast(programme.getUniqueProgrammeIdentifier());
//Close the ExtendedEWA DB
ExtendedEWA.CloseExtendedEWADB();
//If any cast was found load up the information
if (cast.Count > 0)
{
//Create the table arrays to hold any found crew
ArrayList Actors = new ArrayList();
ArrayList Directors = new ArrayList();
ArrayList Producers = new ArrayList();
ArrayList Writers = new ArrayList();
ArrayList ExecProducers = new ArrayList();
ArrayList GuestStars = new ArrayList();
ArrayList Hosts = new ArrayList();
ArrayList Narrators = new ArrayList();
ArrayList Judges = new ArrayList();
ArrayList Contestants = new ArrayList();
ArrayList Guests = new ArrayList();
foreach (ExtendedEWA.Crew crew in cast)
{
switch (crew.Role)
{
case ExtendedEWA.Role.Actor:
Actors.Add(crew);
break;
case ExtendedEWA.Role.Director:
Directors.Add(crew);
break;
case ExtendedEWA.Role.Producer:
Producers.Add(crew);
break;
case ExtendedEWA.Role.Writer:
Writers.Add(crew);
break;
case ExtendedEWA.Role.ExecProducer:
ExecProducers.Add(crew);
break;
case ExtendedEWA.Role.GuestStar:
GuestStars.Add(crew);
break;
case ExtendedEWA.Role.Host:
Hosts.Add(crew);
break;
case ExtendedEWA.Role.Narrator:
Narrators.Add(crew);
break;
case ExtendedEWA.Role.Judge:
Judges.Add(crew);
break;
case ExtendedEWA.Role.Contestant:
Contestants.Add(crew);
break;
case ExtendedEWA.Role.Guest:
Guests.Add(crew);
break;
}
}
//Create first table header row
TableRow headerRow = new TableRow();
//Load the header row with the titles
TableCell actors = new TableCell();
actors.Text = "<b>Actors</b>";
actors.CssClass = "header";
actors.Width = 60;
actors.Wrap = false;
headerRow.Cells.Add(actors);
TableCell directors = new TableCell();
directors.Text = "<b>Directors</b>";
directors.CssClass = "header";
directors.Width = 60;
directors.Wrap = false;
headerRow.Cells.Add(directors);
TableCell producers = new TableCell();
producers.Text = "<b>Exec. Producers</b>";
producers.CssClass = "header";
producers.Width = 60;
producers.Wrap = false;
headerRow.Cells.Add(producers);
TableCell writers = new TableCell();
writers.Text = "<b>Producers</b>";
writers.CssClass = "header";
writers.Width = 60;
writers.Wrap = false;
headerRow.Cells.Add(writers);
TableCell execproducers = new TableCell();
execproducers.Text = "<b>Writers</b>";
execproducers.CssClass = "header";
execproducers.Width = 60;
execproducers.Wrap = false;
headerRow.Cells.Add(execproducers);
TableCell gueststars = new TableCell();
gueststars.Text = "<b>Guest Stars</b>";
gueststars.CssClass = "header";
gueststars.Width = 60;
gueststars.Wrap = false;
headerRow.Cells.Add(gueststars);
TableCell hosts = new TableCell();
hosts.Text = "<b>Hosts</b>";
hosts.CssClass = "header";
hosts.Width = 60;
hosts.Wrap = false;
headerRow.Cells.Add(hosts);
TableCell narrators = new TableCell();
narrators.Text = "<b>Narrators</b>";
narrators.CssClass = "header";
narrators.Width = 60;
narrators.Wrap = false;
headerRow.Cells.Add(narrators);
TableCell judges = new TableCell();
judges.Text = "<b>Judges</b>";
judges.CssClass = "header";
judges.Width = 60;
judges.Wrap = false;
headerRow.Cells.Add(judges);
TableCell contestants = new TableCell();
contestants.Text = "<b>Contestants</b>";
contestants.CssClass = "header";
contestants.Width = 60;
contestants.Wrap = false;
headerRow.Cells.Add(contestants);
TableCell guests = new TableCell();
guests.Text = "<b>Guests</b>";
guests.CssClass = "header";
guests.Width = 60;
guests.Wrap = false;
headerRow.Cells.Add(guests);
CreditsTable.Rows.Add(headerRow);
//Load the rows with data
while (
(Actors.Count > 0) ||
(Directors.Count > 0) ||
(Producers.Count > 0) ||
(Writers.Count > 0) ||
(ExecProducers.Count > 0) ||
(GuestStars.Count > 0) ||
(Narrators.Count > 0) ||
(Judges.Count > 0) ||
(Hosts.Count > 0) ||
(Contestants.Count > 0) ||
(Guests.Count > 0))
{
TableRow crewRow = new TableRow();
AddCell(crewRow, Actors );
AddCell(crewRow, Directors );
AddCell(crewRow, ExecProducers );
AddCell(crewRow, Producers );
AddCell(crewRow, Writers );
AddCell(crewRow, GuestStars );
AddCell(crewRow, Hosts );
AddCell(crewRow, Narrators );
AddCell(crewRow, Judges );
AddCell(crewRow, Contestants );
AddCell(crewRow, Guests );
CreditsTable.Rows.Add(crewRow);
}
}
else
{
//Load the header row with the titles
//Create first table header row
TableRow headerRow = new TableRow();
TableCell noactors = new TableCell();
noactors.Text = "<b>No Credits Available</b>";
noactors.CssClass = "header";
noactors.Width = 75;
noactors.Wrap = false;
headerRow.Cells.Add(noactors);
CreditsTable.Rows.Add(headerRow);
}
}
//Load the show description/date/channel
TableCell desc = new TableCell();
desc.Text = description;
TableRow descRow = new TableRow();
descRow.Cells.Add(desc);
ShowDescTable.Rows.Add(descRow);
showStartDate.Text = programme.getStartTime().ToLongDateString();
showTimes.Text = programme.getStartTime().ToShortTimeString() + " - " + programme.getEndTime().ToShortTimeString();
Channel channel = scheduleHelper.GetChannelByOID(programme.getChannelOID());
string channelName = channel.getName();
if (channelName.StartsWith(channel.getChannelNumber().ToString())) // cosmetic stuff for my american friends
{
channelName = channelName.Substring(channel.getChannelNumber().ToString().Length);
}
showChannel.Text = "<span class=\"channelnumber\"><b>" + channel.getChannelNumber() + "</b></span> (<span class=\"channelname\"><nobr>" + channelName + "</nobr></span>)";
}
}
private void AddCell(TableRow crewRow, ArrayList crewlist)
{
if (crewlist.Count > 0)
{
ExtendedEWA.Crew crew = (ExtendedEWA.Crew)crewlist[0];
crewlist.Remove(crew);
TableCell cell = new TableCell();
cell.Text = "<a href=\"http://www.imdb.com/Find?for=" + crew.GivenName + " " + crew.SurName + "\" onclick=\"EditPop2(this,'IMDB');return false;\">" + crew.GivenName + " " + crew.SurName + "</a>";
crewRow.Cells.Add(cell);
}
else
{
crewRow.Cells.Add(new TableCell());
}
}
private void getTheme()
{
string theme = System.Convert.ToString(Session["theme"]);
if (theme != null && theme != "")
{
return;
}
else
{
HttpCookie cookie = Request.Cookies["theme"];
if (cookie != null && cookie.Value.Length > 0)
{
theme = cookie.Value;
}
else
{
theme = "Default";
}
Session["theme"] = "themes/" + theme;
return;
}
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
}
#endregion
}
}